//
//  RootViewController.m
//  cookBook
//
//  Created by xalo on 16/1/22.
//  Copyright © 2016年 张广斌. All rights reserved.
//

#import "RootViewController.h"
#import "CookListViewController.h"
#import "TopicViewController.h"
#import "CategoryViewController.h"
#import "UserViewController.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //cookList导航控制器
    UINavigationController *cookNC = [[UIStoryboard storyboardWithName:@"CookListSB" bundle:nil] instantiateViewControllerWithIdentifier:@"CookLNC"];
    
    //category导航控制器
    UINavigationController *categoryNC = [[UIStoryboard storyboardWithName:@"CategorySB" bundle:nil] instantiateViewControllerWithIdentifier:@"CategoryNC"];
    
    //topic导航孔子器
    UINavigationController *topicNC = [[UIStoryboard storyboardWithName:@"TopicSB" bundle:nil] instantiateViewControllerWithIdentifier:@"TopicNC"];
    
    //user导航控制器
    UserViewController *userVC = [[UserViewController alloc] initWithStyle:(UITableViewStyleGrouped)];//代码,无storyboard
    
    UINavigationController *userNC = [[UINavigationController alloc] initWithRootViewController:userVC];
    
    
    
    
    //cookList tabBarItem Image
    UIImage *cookImage = [[UIImage imageNamed:@"order"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    [cookNC.tabBarItem setImage:cookImage];
    [cookNC.tabBarItem setTitle:@"菜单列表"];
    
    //category tabBarItem Image
    UIImage *categoryImage = [[UIImage imageNamed:@"order"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    [categoryNC.tabBarItem setImage:categoryImage];
    [categoryNC.tabBarItem setTitle:@"菜品分类"];
    
    //topic tabBarItem Image
    UIImage *topicImage = [[UIImage imageNamed:@"order"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    [topicNC.tabBarItem setImage:topicImage];
    [topicNC.tabBarItem setTitle:@"热门饮食"];
    
    //user tabBarItem Image
    UIImage *userImage = [[UIImage imageNamed:@"order"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    [userNC.tabBarItem setImage:userImage];
    [userNC.tabBarItem setTitle:@"更多"];
    
    
    //标签视图控制器添加视图
    self.viewControllers = @[cookNC,categoryNC,topicNC,userNC];
    
    //tabBar透明度
    self.tabBar.translucent = NO;
    
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
